﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <input type="text" id="code" value="" style="width: 300px" />
     <input id="Button2" type="button" onclick="gettk()" value="button" />
 <script type="text/javascript"></script><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
  <script>      function gettk() {
           // alert("jqXHR.responseText");
            var baseUrl = "https://gw.open.1688.com/openapi/http/1/system.oauth2/getToken/1009066?" ;
            var data = {};
            data.client_id = "1009066";
            data.redirect_uri = "http://gw.open.1688.com/auth/authCode.htm";
            data.code = document.getElementById("code").value.trim();
            data.client_secret = "aiN+~i~ab4_p";
            data.grant_type = "authorization_code";
            data.need_refresh_token = "true";
            jQuery.ajax({
                url: baseUrl,
                data: data,
                type: "POST",
                dataType: "json",
                timeout: 8000,
                success: function(jqXHR){
                    alert(jqXHR.value);
                }
            })
        }
</script>
</body>
</html>
